package main

import (
	"fmt"
	"strconv"
)

func main() {
	for {
		var a, op, b string

		fmt.Println("请输入要计算的内容,用空格间隔:")

		fmt.Scanf("%s %s %s", &a, &op, &b);
		aa, _ := strconv.Atoi(a)
		bb, _ := strconv.Atoi(b)

		var result int;
		switch op{
		case "+":
			result = aa + bb
		case "-":
			result = aa - bb
		case "*":
			result = aa * bb
		case "/":
			result = aa / bb
		default:
			fmt.Println("操作符错误")
		}

		fmt.Printf("计算结果>%s%s%s = %d\n", a, op, b, result);
	}

}

